-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fragment.encrypted unit tests for manifest signalled DRM (PlayReady and Widevine) #2735
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see the url/uri TODO in m3u8-parser addressed here, or with an issue for follow up.
expect(frag.encrypted).to.equal(true); | ||
}); | ||
|
||
it('returns true for widevine v2 manifest signalled encryption', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while these tests return true, currently, via integration they won't ever be set on the fragment as these keys are currently set as "unknown" keyformats, since we don't handle them as a client yet.
When fragments are signalled from the manifest they are encrypted we need to be able to detect this fact. Currently we use the boolean "encrypted" on Fragment to support this. So I've added some tests that cover the current behaviour for AES-128 encryption, and some skipped tests that cover the future usecase. Additionally, this change includes a tiny change to the LevelKey class. It now has a private constructor, and two static methods to create itself. `fromURL` and `fromURI`, one supports the current usecase for absolute or relative URLs, and the other is for supporting the future use-case of URI keys.
We want to download the key not when a fragment reports that it is encrypted. But specifically when it is an identity key, that hasn't been loaded already.
e108026
to
a244799
Compare
This PR will...
When fragments are signalled from the manifest they are encrypted we
need to be able to detect this fact. Currently we use the boolean
"encrypted" on Fragment to support this. So I've added some tests that
cover the current behaviour for AES-128 encryption, and some
skippedtests that cover the future usecase.
Additionally, this change includes a tiny change to the LevelKey class.
It now has a private constructor, and two static methods to create
itself.
fromURL
andfromURI
, one supports the current usecase forabsolute or relative URLs, and the other is for supporting the future
use-case of URI keys.
As the meaning of the
encrypted
getter on Fragment has been changedto mean that a fragment has a
EXT-X-KEY
associated with it, locations where it was usedcurrently for determining if a key needed to be loaded have been changed to
directly reference the appropriate properties.
Why is this Pull Request needed?
We need to know when fragments are encrypted beyond the current
support for AES-128 segments if we are going to notify users when
encrypted content is being encountered from a manifest only
perspective.
Are there any points in the code the reviewer needs to double check?
The unit tests make sense.